ihelpuoo.weboo.runtime.MessageSetHTML = function(fileName)
{
	this.shell = document.createElement("DIV");
	this.title = document.createElement("H2");
	this.title.innerHTML = "Messages : " + fileName;
	this.tabs = document.createElement("DIV");
	this.tabs.className = "msg_tabs";
	this.msgs = document.createElement("DIV");
	
	this.shell.appendChild(this.title);
	this.shell.appendChild(this.tabs);
	this.shell.appendChild(this.msgs);
	
	this.tabIndex = ihelpuoo.util.map();
	this.highlightTab = null;
	
	this.eventHandler = new ihelpuoo.weboo.runtime.MessageSetEventHandler();
}

ihelpuoo.weboo.runtime.MessageSetHTML.prototype
=
{
	addTab: function(moduleName,ls)
	{
		var oTab = new ihelpuoo.weboo.runtime.MessageTabHTML();
		oTab.anchor.innerHTML = ls.name;
		this.tabs.appendChild(oTab.span);
		this.tabIndex.put(ls.name,oTab);
		oTab.anchor.setAttribute("module",moduleName);
		oTab.anchor.setAttribute("locale",ls.name);
		ihelpuoo.event.add(oTab.anchor,"click",this.eventHandler.onClickTab);
	}
	
	,
	highlight: function(tabName)
	{
		var oTab = this.tabIndex.get(tabName);
		if(null==oTab)
			return;
		oTab.anchor.className = "tab_on";
		oTab.span.className = "msg_tab_on";
		this.highlightTab = oTab;
	}
	
	,
	dishighlight: function()
	{
		if(null == this.highlightTab)
			return;
		this.highlightTab.anchor.className = "tab_off";
		this.highlightTab.span.className = "msg_tab_off";
		this.highlightTab = null;
	}
	
	,
	showMessages: function(ls)
	{
		this.dishighlight();
		this.highlight(ls.name);
		var msgHTML = ls.render();
		if(!ihelpuoo.dom.contains(this.msgs,msgHTML))
			this.msgs.appendChild(msgHTML);
	}
}

ihelpuoo.weboo.runtime.MessageTabHTML = function()
{
	this.span = document.createElement("SPAN");
	this.span.className = "msg_tab_off";
	this.img = document.createElement("IMG");
	this.img.className = "icon16";
	this.img.src = ihelpuoo.http.server().icon("004.gif");
	this.anchor = document.createElement("A");
	this.anchor.className = "tab_off";
	this.anchor.href = "javascript:void(0)";
	this.span.appendChild(this.img);
	this.span.appendChild(this.anchor);
}

ihelpuoo.weboo.runtime.MessageTabHTML.prototype
=
{

}